From: Florian Müllner Date: Fri, 9 Jun 2023 17:52:15 +0000 (+0200) Subject: st/texture-cache: Set up sliced images to fill parent X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~337^2~2^2~4 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ebbcc31fbd1cb6c733225edb876d148101fc7aac;p=gnome-shell.git st/texture-cache: Set up sliced images to fill parent When using fractional scaling, the size of the loaded image with applied scaling may still differ from the displayed size. This is currently addressed by syncing the size of all slice actors in the (probably only) caller. Instead, set the actors to fill their parent automatically. Part-of: --- diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index bbe31bda7..7037c07d1 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1321,6 +1321,12 @@ on_sliced_image_loaded (GObject *source_object, if (g_task_had_error (task) || g_cancellable_is_cancelled (data->cancellable)) return; + clutter_actor_set_layout_manager (data->actor, + g_object_new (CLUTTER_TYPE_BIN_LAYOUT, NULL)); + /* stop propagation of child expand flags */ + clutter_actor_set_x_expand (data->actor, FALSE); + clutter_actor_set_y_expand (data->actor, FALSE); + pixbufs = g_task_propagate_pointer (task, NULL); for (list = pixbufs; list; list = list->next) @@ -1328,6 +1334,10 @@ on_sliced_image_loaded (GObject *source_object, ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data), data->paint_scale, data->resource_scale); + clutter_actor_set_x_expand (actor, TRUE); + clutter_actor_set_y_expand (actor, TRUE); + clutter_actor_set_x_align (actor, CLUTTER_ACTOR_ALIGN_FILL); + clutter_actor_set_y_align (actor, CLUTTER_ACTOR_ALIGN_FILL); clutter_actor_hide (actor); clutter_actor_add_child (data->actor, actor); }